using System;
using System.Collections.Generic;
using System.Text;

namespace WCSFContrib.ECommerceCatalog.BusinessEntities
{
    public class Item
    {
        private int itemId;

        public int ItemId
        {
            get { return itemId; }
            set { itemId = value; }
        }

        private string name;

        public string Name
        {
            get { return name; }
            set { name = value; }
        }

        private string description;

        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        private string image;

        public string Image
        {
            get { return image; }
            set { image = value; }
        }

        private int stock;

        public int Stock
        {
            get { return stock; }
            set { stock = value; }
        }
	
        private double price;

        public double Price
        {
            get { return price; }
            set { price = value; }
        }

        private Category category;

        public Category Category
        {
            get { return category; }
            set { category = value; }
        }

        public Item()
        {
        }

        public Item(int itemId, string name, string description, string image, int stock, double price, Category category)
        {
            if (category == null)
                return;
            
            this.itemId = itemId;
            this.name = name;
            this.description = description;
            this.image = image;
            this.stock = stock;
            this.price = price;
            this.category = new Category(category.CategoryId, category.Code, category.Name, category.ParentCategory);
        }
    }
}
